package com.kaifamiao.N0729;

import java.util.Scanner;

public class Testt {

    public static void main(String[] args) {

        Host host = new Host();
        Pett pett = null;

        Scanner onput = new Scanner(System.in);
        System.out.println("请输入要玩的次数");
        int choices = onput.nextInt();

        for(int i = 0;i<choices;i++) {

            Scanner input = new Scanner(System.in);
            System.out.println("请输入宠物：1.狗狗   2.猫猫   3.鸭子");
            int choice = input.nextInt();

            switch (choice) {
                case 1:
                    System.out.println("主人选择的是狗狗");
                    pett = new Dog1();
                    break;
                case 2:
                    System.out.println("主人选择的是猫猫");
                    pett = new Cat();
                    break;
                case 3:
                    System.out.println("主人选择的是鸭子");
                    pett = new Duck();
                    break;
            }
            host.letCry(pett);
            System.out.println("******************");
        }
    }
}
